Skip to content

fix(ci): fix SonarCloud coverage — use src/**/*.spec.ts instead of test/#8

Merged
y-aithnini merged 1 commit intodevelopfrom
fix/sonar-test-inclusions
Apr 6, 2026
Merged

fix(ci): fix SonarCloud coverage — use src/**/*.spec.ts instead of test/#8
y-aithnini merged 1 commit intodevelopfrom
fix/sonar-test-inclusions

Conversation

@y-aithnini
Copy link
Copy Markdown

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

@y-aithnini y-aithnini requested a review from a team as a code owner April 6, 2026 08:18
Copilot AI review requested due to automatic review settings April 6, 2026 08:18
@y-aithnini y-aithnini merged commit bf3a3dd into develop Apr 6, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the SonarCloud scan configuration in the release-check CI workflow to better align Sonar’s test detection with this repo’s actual Jest test layout (tests primarily live under src/**/*.spec.ts rather than only under test/).

Changes:

  • Replaces sonar.tests=test with sonar.test.inclusions=src/**/*.spec.ts in the SonarCloud scan step.

-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }}
-Dsonar.sources=src
-Dsonar.tests=test
-Dsonar.test.inclusions=src/**/*.spec.ts
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest.config.ts runs tests from both src/**/*.spec.ts and test/**/*.test.ts, but the Sonar config now only marks src/**/*.spec.ts as tests. This will cause the test/ suite (e.g. test/smoke.test.ts) to be ignored/misclassified in SonarCloud. Consider setting sonar.tests to include both src and test and expanding sonar.test.inclusions accordingly (and, if needed, excluding **/*.spec.ts from sonar.sources to avoid counting tests as main sources).

Suggested change
-Dsonar.test.inclusions=src/**/*.spec.ts
-Dsonar.tests=src,test
-Dsonar.test.inclusions=src/**/*.spec.ts,test/**/*.test.ts
-Dsonar.exclusions=src/**/*.spec.ts

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants